// components/MeasurePanel/measurePanel.js
const utils = require("../../utils/util.js")
const compareVersion = require("../../utils/compareVersion.js")
Component({

  options: {
    multipleSlots: true // 在组件定义时的选项中启用多slot支持
  },

  /**
   * 组件的属性列表
   */
  properties: {
    measure: {
      type: Object,
      value: {}
    },
    hideNameDes: {
      type: Boolean,
      value: false
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    version: compareVersion(wx.getSystemInfoSync().SDKVersion)
  },

  /**
   * 组件的方法列表
   */
  methods: {
    //点击列表显示隐藏
    onClickToggleExtend: function (e) {      
      const { measure } = this.data
      const index = e.currentTarget.dataset.index;      
      
      measure.reportItemList[index].isExtend = !measure.reportItemList[index].isExtend

      this.setData({
        measure
      })
    }

  }
})
